package com.janyee.powerdroid.http

import com.alibaba.fastjson.JSONObject
import com.janyee.powerdroid.http.callback.BaseCallBack
import com.janyee.powerdroid.http.callback.ICallBack
import com.janyee.powerdroid.http.callback.JsonCallBack

import java.io.IOException

import okhttp3.Call
import okhttp3.Callback
import okhttp3.MediaType
import okhttp3.RequestBody
import okhttp3.Response

/**
 * Created by kmlixh on 2017/2/22.
 * useage:
 * PowerDroid
 */

class JsonRequest(url: String, jsonObject: JSONObject, callback: BaseCallBack<*,*>?) : Request() {
    var jsonObject:JSONObject?=null
    init {
        this.jsonObject = jsonObject
        requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), jsonObject.toJSONString())
        this.url=url
        this.callback = callback
        this.jsonObject=jsonObject
    }
}
